home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / board / Chaos53src.lha / chaos / src / Chaos_Cat.c < prev    next >
C/C++ Source or Header  |  1994-10-14  |  24KB  |  489 lines

  1. /****************************************************************
  2.    This file was created automatically by `FlexCat V1.3'
  3.    Do NOT edit by hand!
  4. ****************************************************************/
  5.  
  6. #include <string.h>
  7.  
  8. #include <exec/memory.h>
  9. #include <libraries/iffparse.h>
  10.  
  11. #include <clib/iffparse_protos.h>
  12. #include <clib/locale_protos.h>
  13. #include <clib/dos_protos.h>
  14. #include <clib/exec_protos.h>
  15. #include <clib/utility_protos.h>
  16.  
  17. #ifdef AZTEC_C
  18. #include <pragmas/locale_lib.h>
  19. #include <pragmas/iffparse_lib.h>
  20. #include <pragmas/dos_lib.h>
  21. #include <pragmas/exec_lib.h>
  22. #include <pragmas/utility_lib.h>
  23. #endif    /*  AZTEC_C            */
  24.  
  25. #if defined(__SASC)  ||  defined(_DCC)  ||  defined(__MAXON__)
  26. #include <pragmas/locale_pragmas.h>
  27. #include <pragmas/iffparse_pragmas.h>
  28. #include <pragmas/dos_pragmas.h>
  29. #include <pragmas/exec_pragmas.h>
  30. #include <pragmas/utility_pragmas.h>
  31. #endif    /*  __SASC  ||    _DCC  ||  __MAXON__ */
  32.  
  33. #ifdef __GNUC__
  34. #include <inline/locale.h>
  35. #include <inline/iffparse.h>
  36. #include <inline/dos.h>
  37. #include <inline/exec.h>
  38. #include <inline/utility.h>
  39. #endif    /*  __GNUC__    */
  40.  
  41.  
  42. extern struct Library *UtilityBase;
  43. extern struct DosLibrary *DOSBase;
  44. extern struct ExecBase *SysBase;
  45.  
  46.  
  47.  
  48.  
  49. static LONG Chaos_Version = 8;
  50. static const STRPTR Chaos_BuiltInLanguage = (STRPTR) "english";
  51.  
  52. struct FC_Type
  53. {   LONG    ID;
  54.     STRPTR  Str;
  55. };
  56.  
  57. const struct FC_Type _MSG_CDAT_SELECTION = { 0, "Tournamentfile-selection" };
  58. const struct FC_Type _MSG_NO_WRITE_FILE = { 1, "Cannot open %s as write-file!\nDOS-Error %ld" };
  59. const struct FC_Type _MSG_WRITE_ERROR = { 2, "DOS-Error %ld while writing %s!" };
  60. const struct FC_Type _MSG_NO_READ_FILE = { 3, "Cannot open %s as read-file!\nDOS-Error %ld" };
  61. const struct FC_Type _MSG_NO_CHAOS_FILE = { 4, "%s is no Chaos-V5-file!" };
  62. const struct FC_Type _MSG_READ_ERROR = { 5, "DOS-Error %ld while reading %s!" };
  63. const struct FC_Type _MSG_ATTENTION = { 6, "Attention!" };
  64. const struct FC_Type _MSG_CHANGES_MADE = { 7, "Changes have been made!\nDo you want to save the tournament first?" };
  65. const struct FC_Type _MSG_YES_NO = { 8, "Yes|No" };
  66. const struct FC_Type _MSG_NO_TOURNAMENT_INPUT_WINDOW = { 9, "Cannot open Tournament-input-window!" };
  67. const struct FC_Type _MSG_NO_PAIRING = { 10, "No pairings possible!\nToo much rounds?" };
  68. const struct FC_Type _MSG_NO_PRINTER = { 11, "Cannot connect to printer!" };
  69. const struct FC_Type _MSG_PAGENR = { 12, "Page" };
  70. const struct FC_Type _MSG_NAME_OUTPUT = { 13, "Name" };
  71. const struct FC_Type _MSG_DWZ_OUTPUT = { 14, "Rating" };
  72. const struct FC_Type _MSG_CHESSCLUB_OUTPUT = { 15, "Chess-club" };
  73. const struct FC_Type _MSG_STREET_OUTPUT = { 16, "Home" };
  74. const struct FC_Type _MSG_VILLAGE_OUTPUT = { 17, "Address" };
  75. const struct FC_Type _MSG_BIRTHDAY_OUTPUT = { 18, "Birthday" };
  76. const struct FC_Type _MSG_PHONE_OUTPUT = { 19, "Phone" };
  77. const struct FC_Type _MSG_PLAYER_LIST_TITLE = { 20, "List of players" };
  78. const struct FC_Type _MSG_RESULT_OUTPUT = { 21, "Result" };
  79. const struct FC_Type _MSG_WHITE_OUTPUT = { 22, "White" };
  80. const struct FC_Type _MSG_BLACK_OUTPUT = { 23, "Black" };
  81. const struct FC_Type _MSG_ROUND_TITLE = { 24, "Games of round %ld" };
  82. const struct FC_Type _MSG_PLACE_OUTPUT = { 25, "Place" };
  83. const struct FC_Type _MSG_POINTS_OUTPUT = { 26, "Points" };
  84. const struct FC_Type _MSG_BUCHHOLZ_OUTPUT = { 27, "Buchholz" };
  85. const struct FC_Type _MSG_EXT_BUCHHOLZ_OUTPUT = { 28, "Ext.Bchh." };
  86. const struct FC_Type _MSG_SONNEBORN_BERGER_OUTPUT = { 29, "SnnBrgr." };
  87. const struct FC_Type _MSG_TABLE_TITLE = { 30, "Table of round %ld %s" };
  88. const struct FC_Type _MSG_TABLE_TITLE2 = { 31, "Table %s" };
  89. const struct FC_Type _MSG_RANKINGS_TITLE = { 32, "Ratings" };
  90. const struct FC_Type _MSG_NUMBER = { 33, "Nr." };
  91. const struct FC_Type _MSG_RANKINGS_TITLE2 = { 34, "List of rankings (round %ld)" };
  92. const struct FC_Type _MSG_PROGRESS_TABLE_TITLE = { 35, "Table of progress until round %ld" };
  93. const struct FC_Type _MSG_GAME_OUTPUT = { 36, "Opponent (Nr., Result, Color)" };
  94. const struct FC_Type _MSG_FREE_GAME_OUTPUT = { 37, "    free" };
  95. const struct FC_Type _MSG_GONE_OUTPUT = { 38, " dropped" };
  96. const struct FC_Type _MSG_FREE_POINT_OUTPUT = { 39, "1 p. bye" };
  97. const struct FC_Type _MSG_FREE_GAME_OUTPUT2 = { 40, "free" };
  98. const struct FC_Type _MSG_NO_FIGHT_OUTPUT = { 41, "(np)" };
  99. const struct FC_Type _MSG_ROUND_INPUT_TITLE = { 42, "Input of games (round %ld)" };
  100. const struct FC_Type _MSG_NEW_PLAYER_REQUEST = { 43, "Games have already been paired!\nDo you really want to add new players?" };
  101. const struct FC_Type _MSG_MODIFY_PLAYER_REQUEST = { 44, "Games have already been paired!\nDo you really want to modify players?" };
  102. const struct FC_Type _MSG_DELETE_PLAYER_REQUEST = { 45, "Games have already been paired!\nDo you really want to delete players?\n"\
  103.     "(Mark them as withdrawn.)" };
  104. const struct FC_Type _MSG_DELETE_THIS_PLAYER_REQUEST = { 46, "Do you really want to delete\nthe player %s?" };
  105. const struct FC_Type _MSG_THIS_PLAYER_GONE_REQUEST = { 47, "Do you really want to mark\n%s as withdrawn?" };
  106. const struct FC_Type _MSG_DONT_CARE_REQUEST_TITLE = { 48, "Don't care!" };
  107. const struct FC_Type _MSG_DONT_CARE_REQUEST = { 49, "Player %s\nhas already been marked as withdrawn!" };
  108. const struct FC_Type _MSG_OK = { 50, "Ok" };
  109. const struct FC_Type _MSG_OK_SC = { 51, "o" };
  110. const struct FC_Type _MSG_ERROR_REQUEST = { 52, "Error!" };
  111. const struct FC_Type _MSG_MEMORY_ERROR = { 53, "Out of memory!" };
  112. const struct FC_Type _MSG_SWISS_PAIRING = { 54, "Swiss pairing" };
  113. const struct FC_Type _MSG_RUNDENTURNIER = { 55, "Round Robin (FIDE-system)" };
  114. const struct FC_Type _MSG_RUTSCHSYSTEM = { 56, "Round Robin (shift-system)" };
  115. const struct FC_Type _MSG_TOURNAMENT_INPUT_TITLE = { 57, "Input of tournament-data" };
  116. const struct FC_Type _WND_PLAYER_ADD_TITLE = { 58, "Input of new players" };
  117. const struct FC_Type _MSG_WHITE_WINS_INPUT = { 59, "\033uW\033nhite wins" };
  118. const struct FC_Type _MSG_DRAW_INPUT = { 60, "\033uD\033nraw" };
  119. const struct FC_Type _MSG_BLACK_WINS_INPUT = { 61, "\033uB\033nlack wins" };
  120. const struct FC_Type _MSG_RESULT_MISSING_INPUT = { 62, "Result \033u\033nmissing" };
  121. const struct FC_Type _MSG_AUSGETRAGEN_INPUT = { 63, "\033uP\033nlayed" };
  122. const struct FC_Type _MSG_KAMPFLOS_INPUT = { 64, "\033uN\033not played" };
  123. const struct FC_Type _MSG_TOURNAMENT_MENU = { 65, "Project" };
  124. const struct FC_Type _MSG_TOURNAMENT_NEW_ITEM = { 66, "New" };
  125. const struct FC_Type _MSG_TOURNAMENT_LOAD_ITEM = { 67, "Load" };
  126. const struct FC_Type _MSG_TOURNAMENT_SAVE_ITEM = { 68, "Save" };
  127. const struct FC_Type _MSG_TOURNAMENT_SAVEAS_ITEM = { 69, "Save as" };
  128. const struct FC_Type _MSG_TOURNAMENT_ABOUT_ITEM = { 70, "About" };
  129. const struct FC_Type _MSG_TOURNAMENT_QUIT_ITEM = { 71, "Quit" };
  130. const struct FC_Type _MSG_PLAYER_MENU = { 72, "Players" };
  131. const struct FC_Type _MSG_PLAYER_ADD_ITEM = { 73, "Add" };
  132. const struct FC_Type _MSG_PLAYER_IMPORT_ITEM = { 74, "Import" };
  133. const struct FC_Type _MSG_PLAYER_MODIFY_ITEM = { 75, "Modify" };
  134. const struct FC_Type _MSG_PLAYER_DELETE_ITEM = { 76, "Delete" };
  135. const struct FC_Type _MSG_ROUND_MENU = { 77, "Round" };
  136. const struct FC_Type _MSG_ROUND_PAIRINGS_ITEM = { 78, "Make pairings" };
  137. const struct FC_Type _MSG_ROUND_PAIRINGS_SWISS_SUB = { 79, "Swiss pairing" };
  138. const struct FC_Type _MSG_ROUND_PAIRINGS_RROBIN_SUB = { 80, "Round Robin (FIDE-system)" };
  139. const struct FC_Type _MSG_ROUND_PAIRINGS_SLIDE_SUB = { 81, "Round Robin (shift-system)" };
  140. const struct FC_Type _MSG_ROUND_RESULTS_ITEM = { 82, "Enter results" };
  141. const struct FC_Type _MSG_OUTPUT_MENU = { 83, "Output" };
  142. const struct FC_Type _MSG_OUTPUT_PLAYERS_ITEM = { 84, "Player-list" };
  143. const struct FC_Type _MSG_OUTPUT_PLAYERS_SHORT_SUB = { 85, "short" };
  144. const struct FC_Type _MSG_OUTPUT_PLAYERS_LONG_SUB = { 86, "long" };
  145. const struct FC_Type _MSG_OUTPUT_RANKINGS_ITEM = { 87, "Rankings" };
  146. const struct FC_Type _MSG_OUTPUT_ROUND_ITEM = { 88, "Round" };
  147. const struct FC_Type _MSG_OUTPUT_TABLE_ITEM = { 89, "Table" };
  148. const struct FC_Type _MSG_OUTPUT_TABLE_ALL_SUB = { 90, "All" };
  149. const struct FC_Type _MSG_OUTPUT_TABLE_SENIORS_SUB = { 91, "Seniors" };
  150. const struct FC_Type _MSG_OUTPUT_TABLE_JUNIORS_SUB = { 92, "Juniors" };
  151. const struct FC_Type _MSG_OUTPUT_TABLE_WOMEN_SUB = { 93, "Women" };
  152. const struct FC_Type _MSG_OUTPUT_TABLE_JUNIORSA_SUB = { 94, "Juniors (A)" };
  153. const struct FC_Type _MSG_OUTPUT_TABLE_JUNIORSB_SUB = { 95, "Juniors (B)" };
  154. const struct FC_Type _MSG_OUTPUT_TABLE_JUNIORSC_SUB = { 96, "Juniors (C)" };
  155. const struct FC_Type _MSG_OUTPUT_TABLE_JUNIORSD_SUB = { 97, "Juniors (D)" };
  156. const struct FC_Type _MSG_OUTPUT_TABLE_JUNIORSE_SUB = { 98, "Juniors (E)" };
  157. const struct FC_Type _MSG_OUTPUT_PROGRESSTABLE_ITEM = { 99, "Table of progress" };
  158. const struct FC_Type _MSG_OUTPUT_DWZ_ITEM = { 100, "DWZ-report" };
  159. const struct FC_Type _MSG_OUTPUT_CROSSTABLE_ITEM = { 101, "Cross-table" };
  160. const struct FC_Type _MSG_OUTPUT_CROSSTABLE_ASC_SUB = { 102, "Ascii" };
  161. const struct FC_Type _MSG_OUTPUT_CROSSTABLE_TEX_SUB = { 103, "TeX" };
  162. const struct FC_Type _MSG_OUTPUT_PLAYERCARDS_ITEM = { 104, "Player-cards" };
  163. const struct FC_Type _MSG_OUTPUT_PLAYERCARDS_ASC_SUB = { 105, "Ascii" };
  164. const struct FC_Type _MSG_OUTPUT_PLAYERCARDS_TEX_SUB = { 106, "TeX" };
  165. const struct FC_Type _MSG_PREFS_MENU = { 107, "Preferences" };
  166. const struct FC_Type _MSG_PREFS_TMODE_ITEM = { 108, "scoring" };
  167. const struct FC_Type _MSG_PREFS_TMODE_SIMPLE_SUB = { 109, "Simple" };
  168. const struct FC_Type _MSG_PREFS_TMODE_BUCHHOLZ_SUB = { 110, "Buchholz" };
  169. const struct FC_Type _MSG_PREFS_TMODE_EXTBCHHLZ_SUB = { 111, "Buchholz (extended)" };
  170. const struct FC_Type _MSG_PREFS_TMODE_SONNEBORN_SUB = { 112, "Sonneborn-Berger" };
  171. const struct FC_Type _MSG_PREFS_OUT_ITEM = { 113, "Output-Device" };
  172. const struct FC_Type _MSG_PREFS_OUT_SCREEN_SUB = { 114, "Screen" };
  173. const struct FC_Type _MSG_PREFS_OUT_PRTDRAFT_SUB = { 115, "Printer (Draft)" };
  174. const struct FC_Type _MSG_PREFS_OUT_PRTLQ_SUB = { 116, "Printer (LQ)" };
  175. const struct FC_Type _MSG_PREFS_OUT_FILE_SUB = { 117, "File" };
  176. const struct FC_Type _MSG_PREFS_SETGAMES = { 118, "Set Games" };
  177. const struct FC_Type _MSG_PREFS_MAKEICONS_ITEM = { 119, "Make icons" };
  178. const struct FC_Type _MSG_PREFS_SAVEWINDOWSETTINGS = { 120, "Save window settings" };
  179. const struct FC_Type _MSG_SPECIAL_MENU = { 121, "Special" };
  180. const struct FC_Type _MSG_NUM_PLAYERS_OUTPUT = { 122, "Players:" };
  181. const struct FC_Type _MSG_NUM_ROUNDS_OUTPUT = { 123, "Rounds:" };
  182. const struct FC_Type _MSG_TOURNAMENT_NAME_OUTPUT = { 124, "Tournamentname:" };
  183. const struct FC_Type _MSG_TOURNAMENT_FILE_OUTPUT = { 125, "Tournamentfile:" };
  184. const struct FC_Type _MSG_TOURNAMENT_MODE_OUTPUT = { 126, "Tournamentmode:" };
  185. const struct FC_Type _MSG_CANCEL_INPUT = { 127, "Cancel" };
  186. const struct FC_Type _MSG_CANCEL_SC = { 128, "c" };
  187. const struct FC_Type _MSG_OK_INPUT = { 129, "Ok" };
  188. const struct FC_Type _MSG_TOURNAMENT_NAME_INPUT = { 130, "Tournamentname" };
  189. const struct FC_Type _MSG_NAME_INPUT = { 131, "Name" };
  190. const struct FC_Type _MSG_STREET_INPUT = { 132, "Home" };
  191. const struct FC_Type _MSG_VILLAGE_INPUT = { 133, "Address" };
  192. const struct FC_Type _MSG_CHESS_CLUB_INPUT = { 134, "Chess-club" };
  193. const struct FC_Type _MSG_PHONE_INPUT = { 135, "Phone" };
  194. const struct FC_Type _MSG_BIRTHDAY_INPUT = { 136, "Birthday" };
  195. const struct FC_Type _MSG_DWZ_INPUT = { 137, "Rating" };
  196. const struct FC_Type _MSG_ELO_INPUT = { 138, "ELO" };
  197. const struct FC_Type _MSG_SENIORS_INPUT = { 139, "Senior" };
  198. const struct FC_Type _MSG_JUNIORS_INPUT = { 140, "Junior" };
  199. const struct FC_Type _MSG_WOMEN_INPUT = { 141, "Woman" };
  200. const struct FC_Type _MSG_JUNIORSA_INPUT = { 142, "Junior (A)" };
  201. const struct FC_Type _MSG_JUNIORSB_INPUT = { 143, "Junior (B)" };
  202. const struct FC_Type _MSG_JUNIORSC_INPUT = { 144, "Junior (C)" };
  203. const struct FC_Type _MSG_JUNIORSD_INPUT = { 145, "Junior (D)" };
  204. const struct FC_Type _MSG_JUNIORSE_INPUT = { 146, "Junior (E)" };
  205. const struct FC_Type _MSG_MISSING_PLAYER_NAME = { 147, "Players name is missing!" };
  206. const struct FC_Type _MSG_BIRTHDAY_ERROR = { 148, "Error in birthday of player %s!" };
  207. const struct FC_Type _MSG_ABOUT_PERMISSION = { 149, "This program is governed by the terms and conditions of the GNU General "\
  208.     "Public License. A copy should have come with this distribution. (See the "\
  209.     "file COPYING.) In that license it is made clear that you are welcome to "\
  210.     "redistribute either verbatim or modified copies of the program and the "\
  211.     "documentation under certain conditions. Further you are told that this "\
  212.     "program comes with ABSOLUTELY NO WARRANTY!\n\n\n" };
  213. const struct FC_Type _MSG_ABOUT_THANKS1 = { 150, "My thanks go to\n"\
  214.     "\n"\
  215.     "    Stefan Stuntz for MUI. Finally the user interface should be satisfying "\
  216.     "for everyone.\n"\
  217.     "\n"\
  218.     "    Reinhard Spisser and Sebastiano Vigna for the Amiga-version of texinfo. "\
  219.     "The documentation is written using this.\n"\
  220.     "\n"\
  221.     "    The Free Software Foundation for creating texinfo and many other "\
  222.     "excellent programs.\n\n" };
  223. const struct FC_Type _MSG_ABOUT_THANKS2 = { 151, "    The Betatesters: Kai Bolay, Frank Geider, Franz Hemmer, Jürgen Lang "\
  224.     "(Quarvon), Christian Soltenborn and Volker Zink (The_Zinker)\n"\
  225.     "\n"\
  226.     "    My friend Mathias Moersch for his help in the manual's english "\
  227.     "translation: Spending nearly 6 years in the USA finally does some good!\n"\
  228.     "\n"\
  229.     "    The people of #AmigaGer for answering many stupid questions and lots of "\
  230.     "fun, for example PowerStat (Kai Hoffmann), ZZA (Bernhard Möllemann), "\
  231.     "Stargazer (Petra Zeidler), stefanb (Stefan Becker), Tron (Mathias "\
  232.     "Scheler) and ill (Markus Illenseer)\n"\
  233.     "\n"\
  234.     "    Commodore for the Amiga and Kickstart V2.x. Keep on developing and I'll "\
  235.     "be an Amiga-user the next 8 years too. :-)\n"\
  236.     "\n"\
  237.     "    Douglas Adams and Tom Sharpe for creating Arthur Dent and Tom Sharpe. "\
  238.     "My favourite (anti)-heroes!\n"\
  239.     "\n"\
  240.     "    and to my parents for their bath-tub: There's no better place to think "\
  241.     "about something ;-)" };
  242. const struct FC_Type _MSG_NO_BIRTHDAY = { 152, "Player %s doesn't have a birthdate!\n"\
  243.     "Please select an age-group or make another decision:" };
  244. const struct FC_Type _MSG_NO_BIRTHDAY_GADGETS = { 153, "20 or younger|21-25|26 or older|Modify|Skip|Cancel" };
  245. const struct FC_Type _MSG_DWZ_TITLE = { 154, "DWZ-Ratings" };
  246. const struct FC_Type _MSG_ABOUT_TITLE = { 155, "Informations" };
  247. const struct FC_Type _MSG_ELO_OUTPUT = { 156, "ELO" };
  248. const struct FC_Type _MSG_SENIOR_SHORT = { 157, "S" };
  249. const struct FC_Type _MSG_JUNIOR_SHORT = { 158, "J" };
  250. const struct FC_Type _MSG_WOMAN_SHORT = { 159, "W" };
  251. const struct FC_Type _MSG_JUNIORA_SHORT = { 160, "A" };
  252. const struct FC_Type _MSG_JUNIORB_SHORT = { 161, "B" };
  253. const struct FC_Type _MSG_JUNIORC_SHORT = { 162, "C" };
  254. const struct FC_Type _MSG_JUNIORD_SHORT = { 163, "D" };
  255. const struct FC_Type _MSG_JUNIORE_SHORT = { 164, "E" };
  256. const struct FC_Type _MSG_DATE_FORMAT = { 165, "(dd.mm.yyyy)" };
  257. const struct FC_Type _KEY_PROJECT_LOAD = { 166, "L" };
  258. const struct FC_Type _KEY_PROJECT_SAVE = { 167, "S" };
  259. const struct FC_Type _KEY_PROJECT_SAVE_AS = { 168, "A" };
  260. const struct FC_Type _KEY_PROJECT_ABOUT = { 169, "I" };
  261. const struct FC_Type _KEY_PLAYERS_NEW = { 170, "N" };
  262. const struct FC_Type _KEY_PLAYERS_MODIFY = { 171, "M" };
  263. const struct FC_Type _WND_PLAYER_MODSEL_TITLE = { 172, "Select a player to modify" };
  264. const struct FC_Type _MSG_TEXFILE_SELECTION = { 173, "TeX-file-selection" };
  265. const struct FC_Type _MSG_NO_NEW_PLAYERS_ROUND_ROBIN = { 174, "Games have already been paired.\nNo new players possible!" };
  266. const struct FC_Type _MSG_NO_NEW_PLAYERS_SWISS_PAIR = { 175, "It isn't possible to enter new players,\nwhen round 1 is finished!" };
  267. const struct FC_Type _WND_PLAYER_MODIFY_TITLE = { 176, "Player modification" };
  268. const struct FC_Type _WND_PLAYER_DELSEL_TITLE = { 177, "Select a player to delete" };
  269. const struct FC_Type _MSG_NO_PLAYER_DELETE = { 178, "No players may be deleted\n in a round robin tournament!" };
  270. const struct FC_Type _MSG_YES_NO_CANCEL = { 179, "Yes|No|Cancel" };
  271. const struct FC_Type _WND_GAMESET_TITLE = { 180, "Setting of games" };
  272. const struct FC_Type _BUTTON_DELETE_TITLE = { 181, "Delete" };
  273. const struct FC_Type _BUTTON_DELETE_SC = { 182, "d" };
  274. const struct FC_Type _MSG_ONEPOINTBYE_VERYSHORT = { 183, "F" };
  275. const struct FC_Type _WND_ASCIIFILE_TITLE = { 184, "Output file selection" };
  276. const struct FC_Type _WND_RNDSEL_TITLE = { 185, "Round selection" };
  277. const struct FC_Type _WND_RNDSEL_TEXT = { 186, "Please select a round number" };
  278. const struct FC_Type _ERRMSG_CANNOT_OPEN_WINDOW = { 187, "Canot open window: %s" };
  279. const struct FC_Type _MUIERR_OK = { 188, "Ok" };
  280. const struct FC_Type _MUIERR_OutOfMemory = { 189, "Out of memory" };
  281. const struct FC_Type _MUIERR_OutOfGfxMemory = { 190, "Out of chip memory" };
  282. const struct FC_Type _MUIERR_InvalidWindowObject = { 191, "Invalid window object" };
  283. const struct FC_Type _MUIERR_MissingLibrary = { 192, "Missing library" };
  284. const struct FC_Type _MUIERR_NoARexx = { 193, "Cannot create ARexx port" };
  285. const struct FC_Type _MUIERR_SingleTask = { 194, "Application is already running" };
  286. const struct FC_Type _MUIERR_Unknown = { 195, "Unknown error" };
  287. const struct FC_Type _MSG_INVALID_ONEPOINTBYE = { 196, "Number of active players is even:\n"\
  288.     "No one point bye allowed." };
  289. const struct FC_Type _MSG_INVALID_GAME = { 197, "Players %s\n"\
  290.     "and %s\n"\
  291.     "have already been paired in round %ld." };
  292. const struct FC_Type _MSG_INVALID_COLORS = { 198, "Players %s\n"\
  293.     "and %s\n"\
  294.     "had %s pieces in the last two rounds.\n\n"\
  295.     "Do you really want to pair them?" };
  296. const struct FC_Type _MSG_PLAYER_WITHDRAWN = { 199, "Player %s has withdrawn\n"\
  297.     "and cannot be set." };
  298. const struct FC_Type _MSG_INVALID_PLAYER = { 200, "Player %s is already set as\n"\
  299.     "opponent of player %s." };
  300. const struct FC_Type _MSG_HAD_ONEPOINTBYE = { 201, "Player %s already\n"\
  301.     "had an one point bye." };
  302. const struct FC_Type _BUTTON_MODIFY_TITLE = { 202, "Modify" };
  303. const struct FC_Type _BUTTON_MODIFY_SC = { 203, "m" };
  304. const struct FC_Type _RADIO_RESULT_TITLE = { 204, "Result" };
  305. const struct FC_Type _RADIO_MODE_TITLE = { 205, "Mode" };
  306. const struct FC_Type _BUTTON_FINISH = { 206, "Finish" };
  307. const struct FC_Type _BUTTON_FINISH_SC = { 207, "f" };
  308. const struct FC_Type _CYCLE_CHAOSCOLORS = { 208, "Chaos selects colors" };
  309. const struct FC_Type _CYCLE_USERCOLORS = { 209, "User determines colors" };
  310. const struct FC_Type _MSG_COLORS_SET = { 210, "(cd)" };
  311. const struct FC_Type _MSG_INVALID_COLOR = { 211, "Player %s already had\n"\
  312.     "the %s pieces in the last two rounds.\n"\
  313.     "Do you really want this?" };
  314. const struct FC_Type _KEY_RESULT_WHITE = { 212, "w" };
  315. const struct FC_Type _KEY_RESULT_DRAW = { 213, "d" };
  316. const struct FC_Type _KEY_RESULT_BLACK = { 214, "b" };
  317. const struct FC_Type _KEY_RESULT_MISSING = { 215, "m" };
  318. const struct FC_Type _KEY_RESULT_PLAYED = { 216, "p" };
  319. const struct FC_Type _KEY_RESULT_NPLAYED = { 217, "n" };
  320. const struct FC_Type _MSG_PlayerExists = { 218, "A player %s already exists." };
  321. const struct FC_Type _BUTTONS_DELETE_THIS_PLAYER_REQUEST = { 219, "Delete him|Skip him|Cancel" };
  322. const struct FC_Type _BUTTONS_THIS_PLAYER_GONE_REQUEST = { 220, "Withdraw him|Skip him|Cancel" };
  323. const struct FC_Type _MSG_ImportPlayersWinTitle = { 221, "Please select players to import" };
  324. const struct FC_Type _MSG_ImportPlayersOkButton = { 222, "Import" };
  325. const struct FC_Type _MSG_ImportPlayersOkButtonSC = { 223, "i" };
  326. const struct FC_Type _Button_Reverse = { 224, "Reverse" };
  327. const struct FC_Type _Button_Reverse_SC = { 225, "r" };
  328. const struct FC_Type _MSG_PrinterError = { 226, "Cancelling output:\nPrinter trouble." };
  329. const struct FC_Type _MSG_WINNERPOINTS = { 227, "Winner points:" };
  330. const struct FC_Type _MSG_DRAWPOINTS = { 228, "Draw points:" };
  331.  
  332. static struct Catalog *Chaos_Catalog = NULL;
  333. static struct FC_Type *Chaos_OwnCatalog = NULL;
  334. static LONG Chaos_OwnStrings;
  335. static LONG Chaos_OwnBytes;
  336.  
  337. void OpenChaosCatalog(struct Locale *loc, STRPTR language)
  338. { LONG tag, tagarg;
  339.   extern struct Library *LocaleBase;
  340.   extern struct Library *IFFParseBase;
  341.   extern void CloseChaosCatalog(void);
  342.  
  343.   CloseChaosCatalog();  /*  Not needed if the programmer pairs Open-()
  344.              and CloseCatalog() right, but does no harm. */
  345.   if (language == NULL)
  346.   { tag = TAG_IGNORE;
  347.   }
  348.   else
  349.   { tag = OC_Language;
  350.     tagarg = (LONG) language;
  351.   }
  352.   if (LocaleBase != NULL  &&  Chaos_Catalog == NULL)
  353.   { Chaos_Catalog = OpenCatalog(loc, (STRPTR) "Chaos.catalog",
  354.                  OC_BuiltInLanguage, Chaos_BuiltInLanguage,
  355.                  tag, tagarg,
  356.                  OC_Version, Chaos_Version,
  357.                  TAG_DONE);
  358.   }
  359.   if (LocaleBase == NULL  &&  IFFParseBase != NULL  &&  language != NULL  &&
  360.       Stricmp(language, Chaos_BuiltInLanguage) != 0)
  361.   { struct IFFHandle *iffhandle;
  362.     char path[128]; /*    Enough to hold 4 path items (dos.library 3.0)  */
  363.  
  364.     if ((iffhandle = AllocIFF())  !=  NULL)
  365.     { /*  Trying to open the catalog  */
  366.       strcpy(path, "Catalogs");
  367.       AddPart((STRPTR) path, language, sizeof(path));
  368.       AddPart((STRPTR) path, (STRPTR) "Chaos.catalog", sizeof(path));
  369.       if ((iffhandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE))
  370.                  ==  NULL)
  371.       { strcpy(path, "Locale:Catalogs");
  372.     AddPart((STRPTR) path, language, sizeof(path));
  373.     AddPart((STRPTR) path, (STRPTR) "Chaos.catalog", sizeof(path));
  374.     iffhandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE);
  375.       }
  376.  
  377.       if (iffhandle->iff_Stream)
  378.       { InitIFFasDOS(iffhandle);
  379.     if (!OpenIFF(iffhandle, IFFF_READ))
  380.     { if (!PropChunk(iffhandle, MAKE_ID('C','T','L','G'),
  381.              MAKE_ID('S','T','R','S')))
  382.       { struct StoredProperty *sp;
  383.         int error;
  384.  
  385.         for (;;)
  386.         { if ((error = ParseIFF(iffhandle, IFFPARSE_STEP))
  387.              ==  IFFERR_EOC)
  388.           { continue;
  389.           }
  390.           if (error != 0)
  391.           { break;
  392.           }
  393.  
  394.           if (sp = FindProp(iffhandle, MAKE_ID('C','T','L','G'),
  395.                 MAKE_ID('S','T','R','S')))
  396.           { LONG *ptr;
  397.         LONG BytesToScan, StrLength;
  398.  
  399.         /*  First scan: Check the number of strings        */
  400.         /*  Note that this assumes that the strings are padded    */
  401.         /*  to a longword boundary!                */
  402.         Chaos_OwnBytes = 0;
  403.         Chaos_OwnStrings = 0;
  404.         BytesToScan = sp->sp_Size;
  405.         ptr = sp->sp_Data;
  406.         while (BytesToScan > 0)
  407.         { ++Chaos_OwnStrings;
  408.           ++ptr;              /*  Skip ID        */
  409.           StrLength = *ptr+1;          /*  NUL-Byte!        */
  410.           Chaos_OwnBytes += StrLength;
  411.           ptr += 1+(StrLength+3)/4;   /*  Skip Length and String*/
  412.           BytesToScan -= 8+((StrLength+3)/4)*4;
  413.         }
  414.  
  415.         /*  Marginal check: BytesToScan has to be 0!        */
  416.         if (BytesToScan == 0)
  417.         { char *cptr;
  418.           LONG i;
  419.  
  420.           if (Chaos_OwnCatalog = (struct FC_Type *)
  421.               AllocMem(Chaos_OwnStrings*sizeof(struct FC_Type)+Chaos_OwnBytes,
  422.                    MEMF_ANY))
  423.           { /*    Second scan: Copy the strings and their ID's    */
  424.             cptr = (char *) &Chaos_OwnCatalog[Chaos_OwnStrings];
  425.             BytesToScan = sp->sp_Size;
  426.             ptr = sp->sp_Data;
  427.             i = 0;
  428.             while (BytesToScan > 0)
  429.             { Chaos_OwnCatalog[i].ID = *(ptr++);
  430.               Chaos_OwnCatalog[i].Str = (STRPTR) cptr;
  431.               StrLength = *ptr+1;     /*  NUL-Byte!        */
  432.               ptr++;
  433.               strncpy(cptr, (char *) ptr, StrLength);
  434.                     /*  Not more, not less bytes!    */
  435.               cptr+=StrLength;
  436.               ptr += (StrLength+3)/4;
  437.               BytesToScan -= 8+((StrLength+3)/4)*4;
  438.               ++i;
  439.             }
  440.             break;
  441.           }
  442.         }
  443.           }
  444.         }
  445.       }
  446.       CloseIFF(iffhandle);
  447.     }
  448.     Close(iffhandle->iff_Stream);
  449.       }
  450.  
  451.       FreeIFF(iffhandle);
  452.     }
  453.   }
  454. }
  455.  
  456.  
  457. void CloseChaosCatalog(void)
  458. { if (LocaleBase != NULL)
  459.   { CloseCatalog(Chaos_Catalog);
  460.   }
  461.   Chaos_Catalog = NULL;
  462.   if (Chaos_OwnCatalog != NULL)
  463.   { FreeMem(Chaos_OwnCatalog,
  464.         Chaos_OwnStrings*sizeof(struct FC_Type)+Chaos_OwnBytes);
  465.     Chaos_OwnCatalog = NULL;
  466.   }
  467. }
  468.  
  469.  
  470. STRPTR GetChaosString(APTR fcstr)
  471. { STRPTR defaultstr = NULL;
  472.   LONG strnum, i;
  473.  
  474.   strnum = ((struct FC_Type *) fcstr)->ID;
  475.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  476.  
  477.   if (Chaos_Catalog == NULL)
  478.   { if (Chaos_OwnCatalog != NULL)
  479.     { for (i = 0;  i < Chaos_OwnStrings;  i++)
  480.        { if (Chaos_OwnCatalog[i].ID == strnum)
  481.      { return(Chaos_OwnCatalog[i].Str);
  482.      }
  483.        }
  484.     }
  485.     return(defaultstr);
  486.   }
  487.   return(GetCatalogStr(Chaos_Catalog, strnum, defaultstr));
  488. }
  489.